package com.scau.beyondboy.dao.impl;
import com.scau.beyondboy.dao.BookDao;
import com.scau.beyondboy.model.BookEntity;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
/**
 * Author:beyondboy
 * Gmail:xuguoli.scau@gmail.com
 * Date: 2015/12/9
 * Time: 21:46
 */
@Repository(value ="bookDao")
public class BookDaoImpl extends  BaseDaoImpl<BookEntity> implements BookDao
{
    @Transactional
    @Override
    public BookEntity searchBoook(int bookid)
    {
        return get(bookid);
    }
    @Transactional
    @Override
    public void insertBook(BookEntity bookEntity)
    {
        saveOrUpdate(bookEntity);
    }
    @Transactional
    @Override
    public boolean modifyBook(int bookid)
    {
        return false;
    }
    @Transactional
    @Override
    public void deleteBook(int bookid)
    {
        deleteByKey(bookid);
    }
}
